Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding constraints on injection-witdrawal cumulation [ANT-1885] #2535

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from

Conversation

a-zakir
Copy link
Contributor

@a-zakir a-zakir commented Dec 16, 2024

No description provided.

@flomnes flomnes changed the title [Ant-1885 ] adding constraints on injection-witdrawal cumulation Adding constraints on injection-witdrawal cumulation [ANT-1885] Dec 16, 2024
Comment on lines 130 to 135
if (!constraint.validate())
{
logs.error() << "Invalid constraint in section: " << section->name;
logs.error() << constraint.getErrorMessage();
return false;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove getErrorMessage by using a "status" for the return value

std::optional<std::string> AdditionalConstraint::validate();

if (auto errorMaybe = constraint.validate(); errorMaybe)
{
    logs.error() << "Invalid constraint in section: " << section->name << errorMaybe.value();
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or throw exceptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants